Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 2 - Providers / Providers Reference
Functions / Opening and Closing Providers


OTCloseProvider

Closes a provider of any type--endpoint, mapper, or service provider.

C INTERFACE
OSStatus OTCloseProvider(ProviderRef ref);
C++ INTERFACE
OSStatus TProvider::Close()
PARAMETERS
ref
The provider reference of the provider to be closed and deleted.
DESCRIPTION
The OTCloseProvider function closes the provider that you specify in the ref parameter. Closing the provider deletes all memory reserved for it in the system heap, deletes its resources, and cancels any provider functions that are currently executing.

Open Transport does not guarantee that all outstanding functions have completed before it closes the provider. It is ultimately your responsibility to make sure that all provider functions that you care about have finished executing, before you close and delete a provider.

WARNING
You need to be sure that are no outstanding T_MEMORY_RELEASED events for a provider before you close the provider. Otherwise, Open Transport attempts to deliver the event to a provider that no longer exists, with unpredictable results, such as crashing the system.
SEE ALSO
To create and open an endpoint, call the OTOpenEndpoint function or the OTAsyncOpenEndpoint function, both described in the chapter "Endpoints" in this book.

To create and open a mapper, call the OTOpenMapper function or the OTAsyncOpenMapper function, both described in the chapter "Mappers" in
this book.

To create and open a AppleTalk service provider, call the OTOpenAppleTalkServices function or the OTAsyncOpenAppleTalkServices function, both described in the chapter "AppleTalk Services" in this book.

To create and open a TCP/IP service provider, call the OTOpenInternetServices function or the OTAsyncOpenInternetServices function, both described in the chapter "TCP/IP Services" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996